﻿<Window x:Class="CPPEI.Coolzon.Designer.Views.NewTemplateWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:CPPEI.Coolzon.Designer.Views"
        xmlns:ui="clr-namespace:CPPEI.Coolzon.UI;assembly=CPPEI.Coolzon.UI"
        xmlns:metadata="clr-namespace:CPPEI.Coolzon.Metadata;assembly=CPPEI.Coolzon.Metadata"
        mc:Ignorable="d"
        Title="NewTemplateWindow" Height="500" Width="600" MinWidth="680" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" Closing="Window_Closing"
        Style="{DynamicResource WindowStyle}">
    <!--<Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/CPPEI.Coolzon.Designer.Views;component/CommonStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>-->
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Grid.Column="0" x:Name="_ctlGrid" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock Text="名称" Grid.Row="0" Grid.Column="0"  Margin="3,5,3,3"/>
            <ui:NameTextbox x:Name="_name" Grid.Row="0" Grid.Column="1" Width="200" Text="" Margin="0,3,0,3" MaxLength="20"/>
            <TextBlock Text="组件类型" Grid.Row="1" Grid.Column="0"  Margin="3,5,3,3"/>
            <ComboBox x:Name="_partType"  Grid.Row="1" Grid.Column="1" Width="200"  Margin="0,3,0,3" SelectionChanged="_partType_SelectionChanged">
                <ComboBox.ItemTemplate>
                    <DataTemplate DataType="{x:Type metadata:PartLibItem}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock TextAlignment="Center" Text="{Binding Path=Caption}"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <Border BorderThickness="1" BorderBrush="Black" Margin="2"  Grid.Row="2" Grid.Column="0"  Grid.ColumnSpan="3">
                <Grid x:Name="_partpanel">

                </Grid>
            </Border>
        </Grid>
        <ScrollViewer x:Name="_ctlScroll" Grid.Row="0" Grid.Column="1">
        <local:PropertyView x:Name="_temProperty">

        </local:PropertyView>
        </ScrollViewer>
        <Grid Grid.Row="2" Grid.ColumnSpan="2" x:Name="_ctlBtn">
            <StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}" Content="确定" Margin="0,0,20,0" Click="Button_Click" />
                <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}" Name="cancel" Content="取消" Margin="20,0,0,0" Click="cancel_Click"></Button>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
